/**
 * This is a generated class and is not intended for modification.  To customize behavior
 * of this value object you may modify the generated sub-class of this class - VoDOHeaderList.as.
 */

package com.model.valueObjects
{
import com.adobe.fiber.services.IFiberManagingService;
import com.adobe.fiber.util.FiberUtils;
import com.adobe.fiber.valueobjects.IValueObject;
import com.model.valueObjects.VOPrice;
import flash.events.Event;
import flash.events.EventDispatcher;
import mx.binding.utils.ChangeWatcher;
import mx.collections.ArrayCollection;
import mx.events.CollectionEvent;
import mx.events.PropertyChangeEvent;
import mx.validators.ValidationResult;

import flash.net.registerClassAlias;
import flash.net.getClassByAlias;
import com.adobe.fiber.core.model_internal;
import com.adobe.fiber.valueobjects.IPropertyIterator;
import com.adobe.fiber.valueobjects.AvailablePropertyIterator;

use namespace model_internal;

[ExcludeClass]
public class _Super_VoDOHeaderList extends flash.events.EventDispatcher implements com.adobe.fiber.valueobjects.IValueObject
{
    model_internal static function initRemoteClassAliasSingle(cz:Class) : void
    {
        try
        {
            if (flash.net.getClassByAlias("VoDOHeaderList") == null)
            {
                flash.net.registerClassAlias("VoDOHeaderList", cz);
            }
        }
        catch (e:Error)
        {
            flash.net.registerClassAlias("VoDOHeaderList", cz);
        }
    }

    model_internal static function initRemoteClassAliasAllRelated() : void
    {
        com.model.valueObjects.VOPrice.initRemoteClassAliasSingleChild();
    }

    model_internal var _dminternal_model : _VoDOHeaderListEntityMetadata;

    /**
     * properties
     */
    private var _internal_sgd_listprice : Number = Number(0);
    private var _internal_serialnumber : int;
    private var _internal_sc_detserialnumber_fk : ArrayCollection;
    private var _internal_unitPrice : Number;
    private var _internal_pro_name : String;
    private var _internal_price_per_unit : Number;
    private var _internal_base_currency_detserialnumber_fk : int;
    private var _internal_part_number : String;
    private var _internal_pro_serialnumber_fk : int;
    private var _internal_delivered_qty : int;
    private var _internal_do_serialnumber : int;
    private var _internal_delivery_order_date : String;
    private var _internal_delivery_order_code : String;
    private var _internal_pro_description : String;
    private var _internal_isSelected : Boolean;
    private var _internal_pro_detserialnumber : int;
    private var _internal_do_detserialnumber : int;
    private var _internal_customer_serialnumber_fk : int;
    private var _internal_sales_con_code : String;
    private var _internal_price_list : ArrayCollection;
    model_internal var _internal_price_list_leaf:com.model.valueObjects.VOPrice;
    private var _internal_default_price : String;

    private static var emptyArray:Array = new Array();

    // Change this value according to your application's floating-point precision
    private static var epsilon:Number = 0.0001;

    /**
     * derived property cache initialization
     */
    model_internal var _cacheInitialized_isValid:Boolean = false;

    model_internal var _changeWatcherArray:Array = new Array();

    public function _Super_VoDOHeaderList()
    {
        _model = new _VoDOHeaderListEntityMetadata(this);

        // Bind to own data properties for cache invalidation triggering
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "sc_detserialnumber_fk", model_internal::setterListenerSc_detserialnumber_fk));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "pro_name", model_internal::setterListenerPro_name));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "part_number", model_internal::setterListenerPart_number));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "delivery_order_date", model_internal::setterListenerDelivery_order_date));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "delivery_order_code", model_internal::setterListenerDelivery_order_code));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "pro_description", model_internal::setterListenerPro_description));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "sales_con_code", model_internal::setterListenerSales_con_code));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "price_list", model_internal::setterListenerPrice_list));
        model_internal::_changeWatcherArray.push(mx.binding.utils.ChangeWatcher.watch(this, "default_price", model_internal::setterListenerDefault_price));

    }

    /**
     * data property getters
     */

    [Bindable(event="propertyChange")]
    public function get sgd_listprice() : Number
    {
        return _internal_sgd_listprice;
    }

    [Bindable(event="propertyChange")]
    public function get serialnumber() : int
    {
        return _internal_serialnumber;
    }

    [Bindable(event="propertyChange")]
    public function get sc_detserialnumber_fk() : ArrayCollection
    {
        return _internal_sc_detserialnumber_fk;
    }

    [Bindable(event="propertyChange")]
    public function get unitPrice() : Number
    {
        return _internal_unitPrice;
    }

    [Bindable(event="propertyChange")]
    public function get pro_name() : String
    {
        return _internal_pro_name;
    }

    [Bindable(event="propertyChange")]
    public function get price_per_unit() : Number
    {
        return _internal_price_per_unit;
    }

    [Bindable(event="propertyChange")]
    public function get base_currency_detserialnumber_fk() : int
    {
        return _internal_base_currency_detserialnumber_fk;
    }

    [Bindable(event="propertyChange")]
    public function get part_number() : String
    {
        return _internal_part_number;
    }

    [Bindable(event="propertyChange")]
    public function get pro_serialnumber_fk() : int
    {
        return _internal_pro_serialnumber_fk;
    }

    [Bindable(event="propertyChange")]
    public function get delivered_qty() : int
    {
        return _internal_delivered_qty;
    }

    [Bindable(event="propertyChange")]
    public function get do_serialnumber() : int
    {
        return _internal_do_serialnumber;
    }

    [Bindable(event="propertyChange")]
    public function get delivery_order_date() : String
    {
        return _internal_delivery_order_date;
    }

    [Bindable(event="propertyChange")]
    public function get delivery_order_code() : String
    {
        return _internal_delivery_order_code;
    }

    [Bindable(event="propertyChange")]
    public function get pro_description() : String
    {
        return _internal_pro_description;
    }

    [Bindable(event="propertyChange")]
    public function get isSelected() : Boolean
    {
        return _internal_isSelected;
    }

    [Bindable(event="propertyChange")]
    public function get pro_detserialnumber() : int
    {
        return _internal_pro_detserialnumber;
    }

    [Bindable(event="propertyChange")]
    public function get do_detserialnumber() : int
    {
        return _internal_do_detserialnumber;
    }

    [Bindable(event="propertyChange")]
    public function get customer_serialnumber_fk() : int
    {
        return _internal_customer_serialnumber_fk;
    }

    [Bindable(event="propertyChange")]
    public function get sales_con_code() : String
    {
        return _internal_sales_con_code;
    }

    [Bindable(event="propertyChange")]
    public function get price_list() : ArrayCollection
    {
        return _internal_price_list;
    }

    [Bindable(event="propertyChange")]
    public function get default_price() : String
    {
        return _internal_default_price;
    }

    /**
     * data property setters
     */

    public function set sgd_listprice(value:Number) : void
    {
        var oldValue:Number = _internal_sgd_listprice;
        if (isNaN(_internal_sgd_listprice) == true || Math.abs(oldValue - value) > epsilon)
        {
            _internal_sgd_listprice = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "sgd_listprice", oldValue, _internal_sgd_listprice));
        }
    }

    public function set serialnumber(value:int) : void
    {
        var oldValue:int = _internal_serialnumber;
        if (oldValue !== value)
        {
            _internal_serialnumber = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "serialnumber", oldValue, _internal_serialnumber));
        }
    }

    public function set sc_detserialnumber_fk(value:*) : void
    {
        var oldValue:ArrayCollection = _internal_sc_detserialnumber_fk;
        if (oldValue !== value)
        {
            if (value is ArrayCollection)
            {
                _internal_sc_detserialnumber_fk = value;
            }
            else if (value is Array)
            {
                _internal_sc_detserialnumber_fk = new ArrayCollection(value);
            }
            else
            {
                throw new Error("value of sc_detserialnumber_fk must be a collection");
            }
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "sc_detserialnumber_fk", oldValue, _internal_sc_detserialnumber_fk));
        }
    }

    public function set unitPrice(value:Number) : void
    {
        var oldValue:Number = _internal_unitPrice;
        if (isNaN(_internal_unitPrice) == true || Math.abs(oldValue - value) > epsilon)
        {
            _internal_unitPrice = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "unitPrice", oldValue, _internal_unitPrice));
        }
    }

    public function set pro_name(value:String) : void
    {
        var oldValue:String = _internal_pro_name;
        if (oldValue !== value)
        {
            _internal_pro_name = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "pro_name", oldValue, _internal_pro_name));
        }
    }

    public function set price_per_unit(value:Number) : void
    {
        var oldValue:Number = _internal_price_per_unit;
        if (isNaN(_internal_price_per_unit) == true || Math.abs(oldValue - value) > epsilon)
        {
            _internal_price_per_unit = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "price_per_unit", oldValue, _internal_price_per_unit));
        }
    }

    public function set base_currency_detserialnumber_fk(value:int) : void
    {
        var oldValue:int = _internal_base_currency_detserialnumber_fk;
        if (oldValue !== value)
        {
            _internal_base_currency_detserialnumber_fk = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "base_currency_detserialnumber_fk", oldValue, _internal_base_currency_detserialnumber_fk));
        }
    }

    public function set part_number(value:String) : void
    {
        var oldValue:String = _internal_part_number;
        if (oldValue !== value)
        {
            _internal_part_number = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "part_number", oldValue, _internal_part_number));
        }
    }

    public function set pro_serialnumber_fk(value:int) : void
    {
        var oldValue:int = _internal_pro_serialnumber_fk;
        if (oldValue !== value)
        {
            _internal_pro_serialnumber_fk = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "pro_serialnumber_fk", oldValue, _internal_pro_serialnumber_fk));
        }
    }

    public function set delivered_qty(value:int) : void
    {
        var oldValue:int = _internal_delivered_qty;
        if (oldValue !== value)
        {
            _internal_delivered_qty = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "delivered_qty", oldValue, _internal_delivered_qty));
        }
    }

    public function set do_serialnumber(value:int) : void
    {
        var oldValue:int = _internal_do_serialnumber;
        if (oldValue !== value)
        {
            _internal_do_serialnumber = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "do_serialnumber", oldValue, _internal_do_serialnumber));
        }
    }

    public function set delivery_order_date(value:String) : void
    {
        var oldValue:String = _internal_delivery_order_date;
        if (oldValue !== value)
        {
            _internal_delivery_order_date = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "delivery_order_date", oldValue, _internal_delivery_order_date));
        }
    }

    public function set delivery_order_code(value:String) : void
    {
        var oldValue:String = _internal_delivery_order_code;
        if (oldValue !== value)
        {
            _internal_delivery_order_code = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "delivery_order_code", oldValue, _internal_delivery_order_code));
        }
    }

    public function set pro_description(value:String) : void
    {
        var oldValue:String = _internal_pro_description;
        if (oldValue !== value)
        {
            _internal_pro_description = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "pro_description", oldValue, _internal_pro_description));
        }
    }

    public function set isSelected(value:Boolean) : void
    {
        var oldValue:Boolean = _internal_isSelected;
        if (oldValue !== value)
        {
            _internal_isSelected = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "isSelected", oldValue, _internal_isSelected));
        }
    }

    public function set pro_detserialnumber(value:int) : void
    {
        var oldValue:int = _internal_pro_detserialnumber;
        if (oldValue !== value)
        {
            _internal_pro_detserialnumber = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "pro_detserialnumber", oldValue, _internal_pro_detserialnumber));
        }
    }

    public function set do_detserialnumber(value:int) : void
    {
        var oldValue:int = _internal_do_detserialnumber;
        if (oldValue !== value)
        {
            _internal_do_detserialnumber = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "do_detserialnumber", oldValue, _internal_do_detserialnumber));
        }
    }

    public function set customer_serialnumber_fk(value:int) : void
    {
        var oldValue:int = _internal_customer_serialnumber_fk;
        if (oldValue !== value)
        {
            _internal_customer_serialnumber_fk = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "customer_serialnumber_fk", oldValue, _internal_customer_serialnumber_fk));
        }
    }

    public function set sales_con_code(value:String) : void
    {
        var oldValue:String = _internal_sales_con_code;
        if (oldValue !== value)
        {
            _internal_sales_con_code = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "sales_con_code", oldValue, _internal_sales_con_code));
        }
    }

    public function set price_list(value:*) : void
    {
        var oldValue:ArrayCollection = _internal_price_list;
        if (oldValue !== value)
        {
            if (value is ArrayCollection)
            {
                _internal_price_list = value;
            }
            else if (value is Array)
            {
                _internal_price_list = new ArrayCollection(value);
            }
            else
            {
                throw new Error("value of price_list must be a collection");
            }
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "price_list", oldValue, _internal_price_list));
        }
    }

    public function set default_price(value:String) : void
    {
        var oldValue:String = _internal_default_price;
        if (oldValue !== value)
        {
            _internal_default_price = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "default_price", oldValue, _internal_default_price));
        }
    }

    /**
     * Data property setter listeners
     *
     * Each data property whose value affects other properties or the validity of the entity
     * needs to invalidate all previously calculated artifacts. These include:
     *  - any derived properties or constraints that reference the given data property.
     *  - any availability guards (variant expressions) that reference the given data property.
     *  - any style validations, message tokens or guards that reference the given data property.
     *  - the validity of the property (and the containing entity) if the given data property has a length restriction.
     *  - the validity of the property (and the containing entity) if the given data property is required.
     */

    model_internal function setterListenerSc_detserialnumber_fk(value:flash.events.Event):void
    {
        if (value is mx.events.PropertyChangeEvent)
        {
            if (mx.events.PropertyChangeEvent(value).newValue)
            {
                mx.events.PropertyChangeEvent(value).newValue.addEventListener(mx.events.CollectionEvent.COLLECTION_CHANGE, model_internal::setterListenerSc_detserialnumber_fk);
            }
        }
        _model.invalidateDependentOnSc_detserialnumber_fk();
    }

    model_internal function setterListenerPro_name(value:flash.events.Event):void
    {
        _model.invalidateDependentOnPro_name();
    }

    model_internal function setterListenerPart_number(value:flash.events.Event):void
    {
        _model.invalidateDependentOnPart_number();
    }

    model_internal function setterListenerDelivery_order_date(value:flash.events.Event):void
    {
        _model.invalidateDependentOnDelivery_order_date();
    }

    model_internal function setterListenerDelivery_order_code(value:flash.events.Event):void
    {
        _model.invalidateDependentOnDelivery_order_code();
    }

    model_internal function setterListenerPro_description(value:flash.events.Event):void
    {
        _model.invalidateDependentOnPro_description();
    }

    model_internal function setterListenerSales_con_code(value:flash.events.Event):void
    {
        _model.invalidateDependentOnSales_con_code();
    }

    model_internal function setterListenerPrice_list(value:flash.events.Event):void
    {
        if (value is mx.events.PropertyChangeEvent)
        {
            if (mx.events.PropertyChangeEvent(value).newValue)
            {
                mx.events.PropertyChangeEvent(value).newValue.addEventListener(mx.events.CollectionEvent.COLLECTION_CHANGE, model_internal::setterListenerPrice_list);
            }
        }
        _model.invalidateDependentOnPrice_list();
    }

    model_internal function setterListenerDefault_price(value:flash.events.Event):void
    {
        _model.invalidateDependentOnDefault_price();
    }


    /**
     * valid related derived properties
     */
    model_internal var _isValid : Boolean;
    model_internal var _invalidConstraints:Array = new Array();
    model_internal var _validationFailureMessages:Array = new Array();

    /**
     * derived property calculators
     */

    /**
     * isValid calculator
     */
    model_internal function calculateIsValid():Boolean
    {
        var violatedConsts:Array = new Array();
        var validationFailureMessages:Array = new Array();

        var propertyValidity:Boolean = true;
        if (!_model.sc_detserialnumber_fkIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_sc_detserialnumber_fkValidationFailureMessages);
        }
        if (!_model.pro_nameIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_pro_nameValidationFailureMessages);
        }
        if (!_model.part_numberIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_part_numberValidationFailureMessages);
        }
        if (!_model.delivery_order_dateIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_delivery_order_dateValidationFailureMessages);
        }
        if (!_model.delivery_order_codeIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_delivery_order_codeValidationFailureMessages);
        }
        if (!_model.pro_descriptionIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_pro_descriptionValidationFailureMessages);
        }
        if (!_model.sales_con_codeIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_sales_con_codeValidationFailureMessages);
        }
        if (!_model.price_listIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_price_listValidationFailureMessages);
        }
        if (!_model.default_priceIsValid)
        {
            propertyValidity = false;
            com.adobe.fiber.util.FiberUtils.arrayAdd(validationFailureMessages, _model.model_internal::_default_priceValidationFailureMessages);
        }

        model_internal::_cacheInitialized_isValid = true;
        model_internal::invalidConstraints_der = violatedConsts;
        model_internal::validationFailureMessages_der = validationFailureMessages;
        return violatedConsts.length == 0 && propertyValidity;
    }

    /**
     * derived property setters
     */

    model_internal function set isValid_der(value:Boolean) : void
    {
        var oldValue:Boolean = model_internal::_isValid;
        if (oldValue !== value)
        {
            model_internal::_isValid = value;
            _model.model_internal::fireChangeEvent("isValid", oldValue, model_internal::_isValid);
        }
    }

    /**
     * derived property getters
     */

    [Transient]
    [Bindable(event="propertyChange")]
    public function get _model() : _VoDOHeaderListEntityMetadata
    {
        return model_internal::_dminternal_model;
    }

    public function set _model(value : _VoDOHeaderListEntityMetadata) : void
    {
        var oldValue : _VoDOHeaderListEntityMetadata = model_internal::_dminternal_model;
        if (oldValue !== value)
        {
            model_internal::_dminternal_model = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "_model", oldValue, model_internal::_dminternal_model));
        }
    }

    /**
     * methods
     */


    /**
     *  services
     */
    private var _managingService:com.adobe.fiber.services.IFiberManagingService;

    public function set managingService(managingService:com.adobe.fiber.services.IFiberManagingService):void
    {
        _managingService = managingService;
    }

    model_internal function set invalidConstraints_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_invalidConstraints;
        // avoid firing the event when old and new value are different empty arrays
        if (oldValue !== value && (oldValue.length > 0 || value.length > 0))
        {
            model_internal::_invalidConstraints = value;
            _model.model_internal::fireChangeEvent("invalidConstraints", oldValue, model_internal::_invalidConstraints);
        }
    }

    model_internal function set validationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_validationFailureMessages;
        // avoid firing the event when old and new value are different empty arrays
        if (oldValue !== value && (oldValue.length > 0 || value.length > 0))
        {
            model_internal::_validationFailureMessages = value;
            _model.model_internal::fireChangeEvent("validationFailureMessages", oldValue, model_internal::_validationFailureMessages);
        }
    }

    model_internal var _doValidationCacheOfSc_detserialnumber_fk : Array = null;
    model_internal var _doValidationLastValOfSc_detserialnumber_fk : ArrayCollection;

    model_internal function _doValidationForSc_detserialnumber_fk(valueIn:Object):Array
    {
        var value : ArrayCollection = valueIn as ArrayCollection;

        if (model_internal::_doValidationCacheOfSc_detserialnumber_fk != null && model_internal::_doValidationLastValOfSc_detserialnumber_fk == value)
           return model_internal::_doValidationCacheOfSc_detserialnumber_fk ;

        _model.model_internal::_sc_detserialnumber_fkIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isSc_detserialnumber_fkAvailable && _internal_sc_detserialnumber_fk == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "sc_detserialnumber_fk is required"));
        }

        model_internal::_doValidationCacheOfSc_detserialnumber_fk = validationFailures;
        model_internal::_doValidationLastValOfSc_detserialnumber_fk = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfPro_name : Array = null;
    model_internal var _doValidationLastValOfPro_name : String;

    model_internal function _doValidationForPro_name(valueIn:Object):Array
    {
        var value : String = valueIn as String;

        if (model_internal::_doValidationCacheOfPro_name != null && model_internal::_doValidationLastValOfPro_name == value)
           return model_internal::_doValidationCacheOfPro_name ;

        _model.model_internal::_pro_nameIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isPro_nameAvailable && _internal_pro_name == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "pro_name is required"));
        }

        model_internal::_doValidationCacheOfPro_name = validationFailures;
        model_internal::_doValidationLastValOfPro_name = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfPart_number : Array = null;
    model_internal var _doValidationLastValOfPart_number : String;

    model_internal function _doValidationForPart_number(valueIn:Object):Array
    {
        var value : String = valueIn as String;

        if (model_internal::_doValidationCacheOfPart_number != null && model_internal::_doValidationLastValOfPart_number == value)
           return model_internal::_doValidationCacheOfPart_number ;

        _model.model_internal::_part_numberIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isPart_numberAvailable && _internal_part_number == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "part_number is required"));
        }

        model_internal::_doValidationCacheOfPart_number = validationFailures;
        model_internal::_doValidationLastValOfPart_number = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfDelivery_order_date : Array = null;
    model_internal var _doValidationLastValOfDelivery_order_date : String;

    model_internal function _doValidationForDelivery_order_date(valueIn:Object):Array
    {
        var value : String = valueIn as String;

        if (model_internal::_doValidationCacheOfDelivery_order_date != null && model_internal::_doValidationLastValOfDelivery_order_date == value)
           return model_internal::_doValidationCacheOfDelivery_order_date ;

        _model.model_internal::_delivery_order_dateIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isDelivery_order_dateAvailable && _internal_delivery_order_date == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "delivery_order_date is required"));
        }

        model_internal::_doValidationCacheOfDelivery_order_date = validationFailures;
        model_internal::_doValidationLastValOfDelivery_order_date = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfDelivery_order_code : Array = null;
    model_internal var _doValidationLastValOfDelivery_order_code : String;

    model_internal function _doValidationForDelivery_order_code(valueIn:Object):Array
    {
        var value : String = valueIn as String;

        if (model_internal::_doValidationCacheOfDelivery_order_code != null && model_internal::_doValidationLastValOfDelivery_order_code == value)
           return model_internal::_doValidationCacheOfDelivery_order_code ;

        _model.model_internal::_delivery_order_codeIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isDelivery_order_codeAvailable && _internal_delivery_order_code == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "delivery_order_code is required"));
        }

        model_internal::_doValidationCacheOfDelivery_order_code = validationFailures;
        model_internal::_doValidationLastValOfDelivery_order_code = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfPro_description : Array = null;
    model_internal var _doValidationLastValOfPro_description : String;

    model_internal function _doValidationForPro_description(valueIn:Object):Array
    {
        var value : String = valueIn as String;

        if (model_internal::_doValidationCacheOfPro_description != null && model_internal::_doValidationLastValOfPro_description == value)
           return model_internal::_doValidationCacheOfPro_description ;

        _model.model_internal::_pro_descriptionIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isPro_descriptionAvailable && _internal_pro_description == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "pro_description is required"));
        }

        model_internal::_doValidationCacheOfPro_description = validationFailures;
        model_internal::_doValidationLastValOfPro_description = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfSales_con_code : Array = null;
    model_internal var _doValidationLastValOfSales_con_code : String;

    model_internal function _doValidationForSales_con_code(valueIn:Object):Array
    {
        var value : String = valueIn as String;

        if (model_internal::_doValidationCacheOfSales_con_code != null && model_internal::_doValidationLastValOfSales_con_code == value)
           return model_internal::_doValidationCacheOfSales_con_code ;

        _model.model_internal::_sales_con_codeIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isSales_con_codeAvailable && _internal_sales_con_code == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "sales_con_code is required"));
        }

        model_internal::_doValidationCacheOfSales_con_code = validationFailures;
        model_internal::_doValidationLastValOfSales_con_code = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfPrice_list : Array = null;
    model_internal var _doValidationLastValOfPrice_list : ArrayCollection;

    model_internal function _doValidationForPrice_list(valueIn:Object):Array
    {
        var value : ArrayCollection = valueIn as ArrayCollection;

        if (model_internal::_doValidationCacheOfPrice_list != null && model_internal::_doValidationLastValOfPrice_list == value)
           return model_internal::_doValidationCacheOfPrice_list ;

        _model.model_internal::_price_listIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isPrice_listAvailable && _internal_price_list == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "price_list is required"));
        }

        model_internal::_doValidationCacheOfPrice_list = validationFailures;
        model_internal::_doValidationLastValOfPrice_list = value;

        return validationFailures;
    }
    
    model_internal var _doValidationCacheOfDefault_price : Array = null;
    model_internal var _doValidationLastValOfDefault_price : String;

    model_internal function _doValidationForDefault_price(valueIn:Object):Array
    {
        var value : String = valueIn as String;

        if (model_internal::_doValidationCacheOfDefault_price != null && model_internal::_doValidationLastValOfDefault_price == value)
           return model_internal::_doValidationCacheOfDefault_price ;

        _model.model_internal::_default_priceIsValidCacheInitialized = true;
        var validationFailures:Array = new Array();
        var errorMessage:String;
        var failure:Boolean;

        var valRes:ValidationResult;
        if (_model.isDefault_priceAvailable && _internal_default_price == null)
        {
            validationFailures.push(new ValidationResult(true, "", "", "default_price is required"));
        }

        model_internal::_doValidationCacheOfDefault_price = validationFailures;
        model_internal::_doValidationLastValOfDefault_price = value;

        return validationFailures;
    }
    

}

}
